<?php
include 'dbconfig.php';
include 'opendb.php';

$table   = 'wp_users';

$doc = new DomDocument ('1.0', 'utf-8');
$root = $doc->appendChild ($doc->createElement ($table.'s'));

function insertEntry ($node, $entry) {
	$node->appendChild ($entry);
}

$rows = mysql_query ("SELECT user_login,user_pass FROM $table");
if ($rows) {
	while ($row = mysql_fetch_assoc ($rows)) {
		$entry = $doc->createElement ($table);
		foreach ($row as $fieldName => $fieldValue) {
			$field = $entry->appendChild ($doc->createElement ($fieldName));
			$field->appendChild ($doc->createTextNode ($fieldValue));
		}
		insertEntry ($root, $entry);
	}
}

header ('Content-Type: text/xml');
echo $doc->saveXML ();
?>